<?php
// +----------------------------------------------------------------------
// | EtrolPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Author:LJQ <liujiqi@etrol.com>
// +-----------------------------------------------------------------------

namespace app\common\model;

use app\common\model\Base;
/**
 * 模型基类
 */
class Workflow extends Base{
	

	protected $name = 'wfflowinfo';

	protected $createTime = 'createTime';
	protected $updateTime = 'updateTime';
	
	
	public function getTypeList(){
		return db('basicinfo')->where('sysCode',29)->column('subsystemName','subsystemNo');
	}
	
	public function getwfTypeAttr($value,$data){
		$typeList = $this->getTypeList();
		if($data['wfType']){
			return $typeList[$data['wfType']];
		}
		return null;
	}
	
	public function steps (){
		return $this->hasMany('Workstep','wfFlowInfoId','id');
	}

	
}